diff options
| author | Dawid Rycerz <dawid@rycerz.xyz> | 2025-07-03 13:09:53 +0300 |
|---|---|---|
| committer | Dawid Rycerz <dawid@rycerz.xyz> | 2025-07-03 13:09:53 +0300 |
| commit | 1e5f5a953588cefa75396454c9aed0a79552db14 (patch) | |
| tree | 733c5bcf71f009acc0bacfbc2269404330c82b5d /src/pages/notes/[...slug].astro | |
| parent | 0bedb68753e7202326383fd10f7af563d7fbc24a (diff) | |
Migrate notes to micro
Diffstat (limited to 'src/pages/notes/[...slug].astro')
| -rw-r--r-- | src/pages/notes/[...slug].astro | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/pages/notes/[...slug].astro b/src/pages/notes/[...slug].astro deleted file mode 100644 index 2ce847d..0000000 --- a/src/pages/notes/[...slug].astro +++ /dev/null @@ -1,31 +0,0 @@ ---- -import { getCollection } from "astro:content"; - -import Note from "@/components/note/Note.astro"; -import PageLayout from "@/layouts/Base.astro"; -import type { GetStaticPaths, InferGetStaticPropsType } from "astro"; - -// if you're using an adaptor in SSR mode, getStaticPaths wont work -> https://docs.astro.build/en/guides/routing/#modifying-the-slug-example-for-ssr -export const getStaticPaths = (async () => { - const allNotes = await getCollection("note"); - return allNotes.map((note) => ({ - params: { slug: note.id }, - props: { note }, - })); -}) satisfies GetStaticPaths; - -export type Props = InferGetStaticPropsType<typeof getStaticPaths>; - -const { note } = Astro.props; - -const meta = { - description: - note.data.description || - `Read about my note posted on: ${note.data.publishDate.toLocaleDateString()}`, - title: note.data.title, -}; ---- - -<PageLayout meta={meta}> - <Note as="h1" note={note} /> -</PageLayout> |
